Repository navigation
SRE-1215: Upgrade @graphql-codegen/cli to 7 and its plugins to their next majors - #10088
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10088 +/- ##
=======================================
Coverage 68.04% 68.04%
=======================================
Files 2006 2009 +3
Lines 206295 206382 +87
Branches 8819 8884 +65
=======================================
+ Hits 140365 140441 +76
+ Misses 64255 64217 -38
- Partials 1675 1724 +49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Move `@graphql-codegen/cli` to 7.4.6 and the official plugins to their next majors (`typescript` and `typescript-operations` 6, `typescript-resolvers` 6, `introspection` 6, `fragment-matcher` 7). This lets `@graphql-tools/utils` resolve to 12.x across the lockfile. `typescript-operations` 6 now emits the Input and Enum types its operations use, so running it in the same file as `typescript` declares them twice. Follow upstream's multi-file setup: `typescript` (and `typescript-resolvers` in hash-api) writes `schema-types.gen.ts`, and `typescript-operations` writes `api-types.gen.ts`, imports schema types through `importSchemaTypesFrom` and re-exports them, so existing imports from `api-types.gen` keep working. Result types no longer carry an optional `__typename` unless the selection requests it, so `useHashInstance` picks the integration flags explicitly. Drop the unused `@graphql-codegen/typescript-graphql-request` from hash-backend-integration; its latest release still depends on the 6.x helpers.
claude
Bot
force-pushed
the
claude/graphql-codegen-v7-migration
branch
from
October 19, 2026 10:01
29efe31 to
1847906
Compare
Apollo Client's `InMemoryCache` adds `__typename` to every selection set except the root operation type, so the frontend and hash-isomorphic-utils operation types set `nonOptionalTypename` and `skipTypeNameForRoot` to match. hash-isomorphic-utils also stops passing `skipTypename` to the `typescript` plugin, so its schema types carry an optional `__typename` like the other workspaces'. `useHashInstance` goes back to destructuring `__typename` away, and the flow run table reads `flowScheduleId` from the query result without casting it to the schema `FlowRun` type.
The schema types plugin now says outright that it generates `__typename`, with a comment on why: Apollo Client adds it to every object in a response except the root operation type. This drops the TODO comments about reverting the `__typename` options, since the runtime behaviour is not expected to change.
CiaranMn
previously approved these changes
Oct 23, 2026
…dsFragmentToSubgraph`
CiaranMn
approved these changes
Oct 23, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested via Slack thread
🌟 Purpose
Prototype of the GraphQL Code Generator major upgrade, so we can see what it costs. The CLI 6 / plugin 5 line depends on
@graphql-tools/utils^11; the new majors depend on^12, so this moves@graphql-tools/utilsfrom 11.0.0 to 12.0.3 everywhere in the lockfile.🔍 Changes
@graphql-codegen/cli^6.2.1→^7.4.6,typescript5.0.9 → 6.1.2,typescript-operations5.0.9 → 6.1.10,typescript-resolvers5.1.7 → 6.1.1,introspection5.0.1 → 6.1.0,fragment-matcher6.0.0 → 7.1.0. Transitively, the@graphql-tools/*loaders,delegate,wrap,executor(1.x → 2.0.3) andgraphql-config5.1.8. Each package resolves to a single version.@graphql-codegen/add7.1.1 is added as a dev dependency where it is used.typescript-operations6 now generates the Input and Enum types its operations use, so running it in the same file astypescriptdeclared those types twice (10 to 18 duplicates per file). This follows upstream's multi-file setup:typescript(plustypescript-resolversin hash-api) writesschema-types.gen.ts, andtypescript-operationswritesapi-types.gen.tswithimportSchemaTypesFrom. Anaddline re-exports the schema types fromapi-types.gen.ts, so no import site changes. Upstream's single-file setup drops thetypescriptplugin, but hash-api imports about 100 resolver and args types and the frontend about 20 object types (such asFlowRun) from it, so we still need it.base-codegen-config.tsis now typed for both plugins, becauseskipTypenamemoved from the shared visitor config to thetypescriptplugin's config.__typenameby default. Apollo Client'sInMemoryCacheadds__typenameto every selection set except the root operation type, so the frontend and hash-isomorphic-utils operation types setnonOptionalTypenameandskipTypeNameForRootto match. hash-isomorphic-utils setsskipTypename: falseon its schema types, so they include__typenametoo. Thefetch-based clients (plugin-browser, hash-playwright) keep the default, since nothing adds__typenamethere. One cast inflow-run-table.tsxno longer typechecked and was dropped. Other changes that applied without type errors: nullable result fields are nowT | nullrather than optional (274 → 27 optional fields in the frontend's operation types), unmapped custom scalars default tounknowninstead ofany, and inputIDisstring | number.@graphql-codegen/typescript-graphql-requestfrom hash-backend-integration. Its latest stable release (7.1.0) still depends on the 6.x helpers that pin@graphql-tools/utils^11, and only an 8.0.0 alpha moves off them.*.gen.*files are gitignored, so they are not in the diff. After formatting before and after the same way, the regenerated output changes by roughly +880 / −870 lines across six workspaces (hash-frontend +352/−467, hash-api +264/−154, plugin-browser +96/−99, hash-playwright +92/−99, hash-isomorphic-utils +69/−42, hash-backend-integration +5/−10). The source diff is 93 added and 32 removed lines, plus the lockfile.Checked locally:
codegenin all six codegen workspaces.lint:tscthrough turbo for hash-isomorphic-utils, hash-backend-utils, hash-api, hash-frontend, plugin-browser, hash-playwright and hash-backend-integration. All clean.test:unitfor hash-isomorphic-utils (360 tests), hash-api (311) and hash-frontend (1450). All pass.yarn install --immutable,yarn dedupe --strategy highest --checkandyarn constraints, all with Yarn 4.18.1.?on result types could hide a mismatch with what Apollo's cache returns at runtime.typescript-operationssetup that upstream recommends would mean replacing their uses of schema object types, and it is out of scope here.